import React from 'react'
import Editor from '@/components/Editor'
import ProForm from '@ant-design/pro-form'
import { Space, Tooltip } from 'antd'
import { DeleteOutlined } from '@ant-design/icons'

const Options = (props) => {
  /**
   * 编辑输入的内容
   */
  const { options, setOption, getOptions, setDetails, setContents, name, content } = props

  return (
    <Space>
      <Tooltip title="删除选项">
        <DeleteOutlined
          onClick={() => setOption(getOptions - 1)}
          style={{ fontSize: '16px', color: 'rgba(238,0,48,0.85)' }}/>
      </Tooltip>
      <ProForm.Item
        name="answer"
        required
        label={String.fromCharCode(options)}
      >
        <Editor
          content={content}
          name={name}
          setDetails={setDetails}
          setContents={setContents}
        />
      </ProForm.Item>
    </Space>
  )
}
export default Options
